package Area;
//动物园区域的基类

import java.util.ArrayList;

import Animal.Animal;
import Interface.DebugMassage;

public class DefaltZooArea implements DebugMassage {
    protected String areaName;
    protected ArrayList<Animal> animalsContent;

    public DefaltZooArea(String name) {
        areaName = name;
        animalsContent = new ArrayList<Animal>();
    }

    // 获取对应的动物
    public ArrayList<Animal> GetAreaAnimal() {
        return animalsContent;
    }

    // 动物园的功能
    protected String AreaFunc() {
        return "一块没有特殊作用的展览区";
    }

    public void AddAnimal(Animal animal) {
        animalsContent.add(animal);
    }

    @Override
    public String GetDebugMassage() {
        String debugMessage = "";
        debugMessage += "这里是区域:" + areaName + "\n";
        debugMessage += AreaFunc() + "\n";
        debugMessage += "这里生活着" + "\n";
        for (Animal animal : animalsContent) {
            debugMessage += animal.GetDebugMassage() + "\n";
        }
        return debugMessage;
    }

}
